package com.designed.pattern.behavioral.strategy.core;

import com.designed.pattern.behavioral.strategy.CashSuper;

/**
 * @author yifei
 * @description
 * @date 2024/1/2
 **/
public class CashRebate extends CashSuper {
    private double moneyRebate = 1d;

    public CashRebate(double moneyRebate) {
        this.moneyRebate = moneyRebate;
    }

    @Override
    public double acceptCash(double price, int num) {

        return price * num * this.moneyRebate;

    }
}
